home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
coreaids.arc
/
CREATE.ASM
< prev
next >
Wrap
Assembly Source File
|
1987-06-25
|
1KB
|
42 lines
; DESC: Creates a new data file V1.00
; IN: *{SEG_VAL} segment and
; *{OFFSET} offset of filename to be created as ASCIIZ string
; *{ATRB} attribute or mode of file as listed in CHG_MOD
; command
; OUT: *{OUTHNDL} handle of file created
; SAMPLE: Callm CREATE,<SEG_VAL,OFFSET,ATRB>,<OUTHNDL>
; ###################################################################
Extrn PUSHALL:Near
Extrn POPALL:Near
Extrn ERRORMSG:Near
CREATEC Segment
Assume CS:CREATEC
Public CREATE
;notice.
DB 'CREATE - V1.00, Copyright 1987, CoreTechs ',0DH,0AH
CREATE Proc Near ;creates a file.
Call PUSHALL
Pop CX ;get the attribute.
Pop DX ;get the filename offset.
Pop DS ;get the segment offset.
Mov AH,3CH ;create a file.
Int 21H
Jc ERROR ;if error, report it.
Push AX ;if no error return handle.
Call POPALL
Ret
ERROR: Push AX ;report error and abort.
Call ERRORMSG
CREATE Endp
CREATEC Ends
End